<div class="layuimini-container">
    <form id="app-form" class="layui-form layuimini-form">


        <div class="layui-form-item">
            <label class="layui-form-label">商品标题</label>
            <div class="layui-input-block">
                <input type="text" name="title" class="layui-input" lay-verify="required" placeholder="请输入商品标题"
                       value="{$row.title|default=''}">
            </div>
        </div>

        <div class="layui-form-item" id="bc">
            {volist name='row.spec' id='spec' key='key'}
            <div class="layui-inline">
                <label class="layui-form-label">商品规格</label>
                <div class="layui-input-inline">
                    <input type="text" name="spec[]" class="layui-input" lay-verify="required" placeholder="请输入规格"
                           autocomplete="off" value="{$spec.name}">
                </div>
                {if $key==1}
                <button class="layui-btn" id="insertBtn" onclick="insertInput();return false"><i class="layui-icon"></i>增加规格
                </button>
                {else/}
                <button class="layui-btn layui-btn-danger deleteBtn" id=""><i class="layui-icon "></i>删除规格</button>
                {/if}
            </div>
            {/volist}
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label required">商品LOGO</label>
            <div class="layui-input-block layuimini-upload">
                <input name="logo" class="layui-input layui-col-xs6" lay-verify="required"
                       placeholder="请上传商品缩略图 尺寸163px*163px"
                       value="{$row.logo|default=''}">
                <div class="layuimini-upload-btn">
                    <span><a class="layui-btn" data-upload="logo" data-upload-number="one"
                             data-upload-exts="png|jpg|ico|jpeg" data-upload-icon="image"><i class="fa fa-upload"></i> 上传</a></span>
                    <span><a class="layui-btn layui-btn-normal" id="select_logo" data-upload-select="logo"
                             data-upload-number="one" data-upload-mimetype="image/*"><i
                            class="fa fa-list"></i> 选择</a></span>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label required">商品图片</label>
            <div class="layui-input-block layuimini-upload">
                <input name="images" class="layui-input layui-col-xs6" lay-verify="required"
                       placeholder="请上传商品缩图片 尺寸395px*319px"
                       value="{$row.images|default=''}">
                <div class="layuimini-upload-btn">
                    <span><a class="layui-btn" data-upload="images" data-upload-number="more"
                             data-upload-exts="png|jpg|ico|jpeg" data-upload-icon="image"><i class="fa fa-upload"></i> 上传</a></span>
                    <span><a class="layui-btn layui-btn-normal" id="select_images" data-upload-select="images"
                             data-upload-number="more" data-upload-mimetype="image/*"><i class="fa fa-list"></i> 选择</a></span>
                </div>
            </div>
        </div>

        {if $row['is_novices_exclusive']==1}
        <!--        <div class-->
        <!--                     ="layui-form-item">-->
        <!--            <label class="layui-form-label">新手专属价格</label>-->
        <!--            <div class="layui-input-block">-->
        <!--                <input type="text" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"-->
        <!--                       name="novice_price" class="layui-input"  placeholder="请输入新手专属价格"-->
        <!--                       value="{$row.novice_price|default=0}">-->
        <!--            </div>-->
        <!--        </div>-->
        {/if}
        <div class="layui-form-item">
            <label class="layui-form-label">市场价格</label>
            <div class="layui-input-block">
                <input type="text" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
                       name="market_price" class="layui-input"
                       lay-verify="required" placeholder="请输入市场价格"
                       value="{$row.market_price|default='0'}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">折扣价格</label>
            <div class="layui-input-block">
                <input type="text" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
                       name="discount_price" class="layui-input"
                       lay-verify="required" placeholder="请输入折扣价格"
                       value="{$row.discount_price|default='0'}">
            </div>
        </div>

        <div class
                     ="layui-form-item">
            <label class="layui-form-label">拼团失败补贴</label>
            <div class="layui-input-block">
                <input type="text" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
                       name="failure_reward" class="layui-input"
                       lay-verify="required"
                       placeholder="请输入拼团失败奖励" value="{$row.failure_reward|default='0'}">
            </div>
        </div>

        <div class
                     ="layui-form-item">
            <label class="layui-form-label">拼团成功奖励</label>
            <div class="layui-input-block">
                <input type="text" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
                       name="success_reward" class="layui-input"
                       lay-verify="required"
                       placeholder="请输入拼团成功奖励" value="{$row.success_reward|default='0'}">
            </div>
        </div>

        <div class
                     ="layui-form-item">
            <label class="layui-form-label">拼团人数</label>
            <div class="layui-input-block">
                <input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" name="collage_num" class="layui-input"
                       lay-verify="required"
                       placeholder="请输入拼团人数" value="{$row.collage_num|default=''}">
            </div>
        </div>
        <div class
                     ="layui-form-item">
            <label class="layui-form-label">每人购买次数</label>
            <div class="layui-input-block">
                <input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" name="buy_num" class="layui-input"
                       lay-verify="required" placeholder="请输入每人购买次数" value="{$row.buy_num|default=''}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">虚拟销量</label>
            <div class="layui-input-block">
                <input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" name="virtual_sales" class="layui-input"
                       lay-verify="required" placeholder="请输入虚拟销量" value="{$row.virtual_sales|default=''}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">商品描述<br>
                <p style="font-size: 10px;color: red">图片宽度：332px</p></label>
            <div class="layui-input-block">
                <textarea name="describe" rows="20" class="layui-textarea editor" placeholder="请输入商品描述">{$row.describe|raw|default=''}</textarea>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-block">
                <input type="number" name="sort" class="layui-input" placeholder="请输入排序"
                       value="{$row.sort|default=''}">
            </div>
        </div>

        <div class="layui-form-item  layui-row layui-col-xs12">
            <label class="layui-form-label required">是否置顶</label>
            <div class="layui-input-block">
                <select name="is_top">
                    <option value="0" {if ($row[
                    'is_top']==0) } selected{/if}>否</option>
                    <option value="1" {if ($row[
                    'is_top']==1) } selected{/if}>是</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注信息</label>
            <div class="layui-input-block">
                <textarea name="remark" class="layui-textarea" placeholder="请输入备注信息">{$row.remark|default=''}</textarea>
            </div>
        </div>

        <div class="hr-line"></div>
        <div class="layui-form-item text-center">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认</button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
        </div>

    </form>
</div>